<template>
  <view class="scenic-item" @click="handleItem">
    <u-image
      show-loading
      :show-menu-by-longpress="false"
      :src="row.cover_img"
      width="100%"
      height="210rpx"
      radius="20rpx 20rpx 0 0"
    />
    <view class="title">{{ row.title }}</view>
    <view class="tags" v-if="row.labelAll.length">
      <view class="tag" v-for="(i, k) in row.labelAll" :key="k">
        {{ i }}
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    row: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  methods: {
    // 点击详情
    handleItem() {
      this.$emit("click", this.row);
    },
  },
};
</script>

<style lang="scss" scoped>
.scenic-item {
  display: inline-block;
  vertical-align: top;
  width: calc(50% - 16rpx);
  height: auto;
  border-radius: 20rpx;
  box-shadow: 0 0 20rpx rgba(186, 186, 186, 0.2);
  margin-bottom: 30rpx;
  padding-bottom: 20rpx;
  .title {
    line-height: 40rpx;
    color: #222222;
    font-size: 24rpx;
    padding: 0 20rpx;
    margin: 20rpx 0;
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .tags {
    padding: 0 20rpx;
    .tag {
      display: inline-block;
      border-radius: 16rpx;
      background-color: rgba(218, 218, 218, 0.4);
      font-size: 20rpx;
      height: 32rpx;
      line-height: 32rpx;
      padding: 0 10rpx;
      color: #979797;
      margin-right: 10rpx;
      &:last-child {
        margin-right: 0;
      }
    }
  }
}
</style>
